package com.tedu.micro.service.stock.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

public interface StockMapper {
    //自定义一个扩展的方法
    @Update("update stock_tbl set stock=stock-#{count} " +
            "where product_code=#{productCode} and " +
            "stock>#{count}")
    Integer reduceStock(@Param("productCode") String productCode,
                        @Param("count") Integer count);
}
